home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Guided Tour of Multimedia (Second Edition)
/
The Guided Tour of Multimedia (Second Edition).iso
/
trials
/
oimdemo
/
setup
/
oimdemo.mst
< prev
next >
Wrap
Text File
|
1995-07-10
|
29KB
|
845 lines
''
'' Open!Info Manager Setup Script.
''
''
'$DEFINE DEBUG ''Define for script development/debugging
''
'' Required includes to interface with MSSETUP DLL's
'' -------------------------------------------------
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''
'' Dialog box id's
'' ---------------
CONST WELCOME = 100
CONST DEST_PATH_DLG = 300
CONST EXITQUIT = 600 '' Exits on user request
CONST EXITSUCCESS = 700 '' Exits when install is done
CONST HELP_DLG = 0 '' The help dialog.
CONST WAIT_DLG = 2100 '' Wait message.
CONST RESTART = 2600
CONST RESTARTII = 2700
CONST INSTALL_DLG = 6200 '' Custom Install Dialog.
CONST TOOBIG = 6300 '' Not enough space on target disk error
CONST BADPATH = 6400 '' Bad destination path error
CONST BADWINDOWS = 6500 '' Wrong Windows release
CONST EXITFAILURE = 6600 '' Exits on error
''
'' String id's
'' -----------
CONST STR_GROUP = "HTI Open!Info Demo"
CONST STR_MPLAYER = "Media Player"
CONST STR_OIM = "Open!Info Manager"
CONST STR_OIR = "Open!Info Reader"
CONST STR_README = "Read Me"
''
'' Miscellaneous Constants
'' -----------------------
CONST NOLOGO = 1 '' Dummy NULL bitmap (must be 1)
CONST LOGO = 2 '' Background bitmap
CONST INSTALLFAILED = 0 '' Install failed for some reason
CONST INSTALLOK = 1 '' Install completed OK
CONST MAX_PATH_STR = 26 '' Maximum path allowed in DBVISTA
CONST MAX_CHARS = 35 '' Maximum path to display.
CONST WINDOW_TITLE = "Open!Info Manager Demo Setup"
CONST PATH_MSG = "The path string length must be less than 27 characters."
CONST ANALYZE_MSG = "We need to analyze your video system to ensure maximum performance. This may take several minutes."
CONST RESTART_MSG = "You need to restart windows before running Open!Info Manager Demo software."
''
'' Custom Install Dialog Option CheckBox Ids
'' -----------------------------------------
CONST APP_CB = 1
CONST DEMO_CB = 2
CONST LAST_CB = 2
''
'' Paths and directory strings
'' ---------------------------
CONST OIM_DIR = "\OIMDEMO"
CONST BIN_DIR = "\BIN"
CONST MB_DIR = "\MB"
CONST BACKUP_DIR = "\BACKUP"
CONST TEXT_DIR = "\MEDIA\TEXT"
CONST IMAGE_DIR = "\MEDIA\IMAGE"
CONST PLAY_DIR = "\MEDIA\PLAYABLE"
CONST DEMO_DIR = "\DEMO"
CONST VFWTMS_DIR = "SETUP\VFWTMS\"
''
'' Various file names
'' ------------------
CONST OIM_INI_NAME = "oim.ini"
CONST OIR_INI_NAME = "oir.ini"
CONST OIM_NAME = "oim.exe"
CONST OIR_NAME = "oir.exe"
CONST INF_FILE_NAME = "setup\oimdemo.inf"
CONST HELP_PROC = ""
''
'' INF file section names
'' ----------------------
CONST PROGRAM_SECT = "Program Files"
CONST DATABASE_SECT = "Database Files"
CONST BACKUP_SECT = "Backup Files"
CONST DEMO_SECT = "Demo Files"
CONST MPLAYER_SECT = "Media Player Files"
CONST VFW_SECT = "VfW Files"
CONST WING_SECT = "WinG Files"
CONST TMS_SECT = "TrueMotion-S Files"
''
'' Global Variables
'' ----------------
GLOBAL DstDir$ '' Default destination directory.
GLOBAL SrcDir$ '' Source directory
GLOBAL WinSysDir$ '' Windows System directory.
GLOBAL WinDir$ '' Windows directory.
GLOBAL WinDrive$ '' Windows drive letter.
GLOBAL ExtraCosts$ '' List of extra costs to add per drive
GLOBAL AppNeeds$ '' Disk space costs per drive for application.
GLOBAL Opt2Needs$ '' Option list costs per drive for demo files.
GLOBAL Opt3Needs$ '' Option list costs per drive for sample files.
GLOBAL Opt4Needs$ '' Option list costs per drive for qtw files.
GLOBAL Success% '' Installation completion code
GLOBAL EnableStatus% '' 3D control status.
GLOBAL DRIVELIST$ '' List of drives.
GLOBAL LISTBOX$ '' List of drives to display in list box.
GLOBAL LISTSELECT$ '' Drive list selection.
GLOBAL CUIDLL$ '' User interface DLL
GLOBAL CHECKSTATES$
GLOBAL STATUSTEXT$
GLOBAL DRIVETEXT$
''
'' Subroutines and Functions
'' -------------------------
DECLARE FUNCTION StartCustomSetup LIB "setupenu.dll" (hinst%, hwnd%) AS INTEGER
DECLARE FUNCTION StopCustomSetup LIB "setupenu.dll" (hinst%, hwnd%) AS INTEGER
DECLARE FUNCTION WritePrivateProfileString LIB "krnl386.exe" (szSect$, szEntry$, szString$, szINI$) AS INTEGER
DECLARE FUNCTION OnWindowsNT LIB "iniupd.dll" AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "iniupd.dll" AS INTEGER
DECLARE FUNCTION ExitWindowsExec LIB "user" (Exec$, Param$) AS INTEGER
DECLARE FUNCTION ctl3dRegister LIB "ctl3d.dll" (hinst%) AS INTEGER
DECLARE FUNCTION ctl3dAutoSubclass LIB "ctl3d.dll" (hinst%) AS INTEGER
DECLARE FUNCTION Ctl3dUnregister LIB "ctl3d.dll" (hinst%) AS INTEGER
''
'' Local subroutines
'' -----------------
DECLARE FUNCTION Install AS INTEGER
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION RemoveOldQTFiles (DeadPath$) AS INTEGER
DECLARE SUB AddOptFilesToCopyList (Option%)
DECLARE SUB EnableCtl3D (Enable%)
DECLARE SUB RecalcPath (Option%)
DECLARE SUB SetDriveStatus
INIT:
''
'' Initialize global vriables
'' --------------------------
WinSysDir$ = GetWindowsSysDir
WinDir$ = GetWindowsDir
Success% = INSTALLFAILED
CUIDLL$ = "setupenu.dll"
AppNeeds$ = "AppNeeds"
Opt2Needs$ = "Opt2Needs"
Opt3Needs$ = "Opt3Needs"
Opt4Needs$ = "Opt4Needs"
ExtraCosts$ = "ExtraCosts"
''
'' Get the Source path and remove the last "\" char
'' ------------------------------------------------
TempDir$ = GetSymbolValue("STF_SRCDIR")
SrcDir$ = MID$(TempDir$, 1, LEN(TempDir$) - 1)
TempDir$ = ""
''
'' Initialize custom setup logic
'' -----------------------------
SetTitle WINDOW_TITLE
i% = StartCustomSetup (HinstFrame(), HwndFrame ())
i% = SetBeepingMode(1)
''
'' Copy the 3D control dll to the windows system to enable the
'' 3D look and feel of dialogs.
'' -----------------------------------------------------------
CopyFile SrcDir$ + "\setup\ctl3dv2.dll", WinSysDir$ + "ctl3dv2.dll", cmoOverwrite, 0
''
'' Make sure that we are running on Windows 3.1 or better
'' ------------------------------------------------------
IF GetWindowsMajorVersion() < 3 THEN
EnableCtl3D 1
sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", HELP_DLG, HELP_PROC)
UIPop 1
GOTO CLEANUP
END IF
IF (GetWindowsMajorVersion() = 3) AND (GetWindowsMinorVersion() < 10) THEN
EnableCtl3D 1
sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", HELP_DLG, HELP_PROC)
UIPop 1
GOTO CLEANUP
END IF
''
'' Make sure that we are running on a 386 or better
'' ------------------------------------------------
IF GetProcessorType() < 3 THEN
EnableCtl3D 1
sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", HELP_DLG, HELP_PROC)
UIPop 1
GOTO CLEANUP
END IF
''
'' Use Wowexec to determine version of NT. 3.1 did not stamp
'' wowexec and wow returns 3.1 as version
'' ----------------------------------------------------------
IF OnWindowsNT() THEN
EnableCtl3D 1
sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", HELP_DLG, HELP_PROC)
UIPop 1
GOTO CLEANUP
END IF
''
'' Setup the custom install dialog symbols
'' ---------------------------------------
AddListItem ExtraCosts$, ""
AddListItem ExtraCosts$, ""
FOR i% = 1 TO 26 STEP 1
AddListItem ExtraCosts$, "16384"
NEXT i%
''
'' default dest to first hard drive
'' since some OEM systems don't start at C:
'' ----------------------------------------
GetLocalHardDrivesList "HardDrives"
NumDrives% = GetListLength("HardDrives")
WinDrive$ = MID$(WinDir$, 1, 1)
DstDir$ = WinDrive$ + ":" + OIM_DIR
CHECKSTATES$ = "CheckItemsState"
STATUSTEXT$ = "StatusItemsText"
DRIVETEXT$ = "DriveStatusText"
FOR i% = 1 TO LAST_CB STEP 1
AddListItem CHECKSTATES$, "OFF"
NEXT i%
ReplaceListItem CHECKSTATES$, 1, "ON"
FOR i% = 1 TO LAST_CB STEP 1
AddListItem STATUSTEXT$, ""
NEXT i%
FOR i% = 1 TO 7 STEP 1
AddListItem DRIVETEXT$, ""
NEXT i%
ReplaceListItem DRIVETEXT$, 7, DstDir$
''
'' Read the INF file
'' -----------------
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szTemp$ = GetSymbolValue("STF_SRCDIR")
SPLITPATH szTemp$, drv$, dir$, filename$, ext$
szInf$ = szTemp$ + INF_FILE_NAME
END IF
ReadInfFile szInf$
EnableCtl3D 1
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", HELP_DLG, HELP_PROC)
IF sz$ = "CONTINUE" THEN
UIPop 1
EnableCtl3D 0
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
''
'' Calculate the disk space required
'' ---------------------------------
'' EnableCtl3D 1
'' sz$ = UIStartDlg(CUIDLL$, WAIT_DLG, "FModelessDlgProc", HELP_DLG, HELP_PROC)
'' FOR i% = 1 TO LAST_CB STEP 1
'' RecalcPath i%
'' NEXT i%
'' SetDriveStatus
'' UIPop 1
'' EnableCtl3D 0
GOTO GETPATH
''
'' Perform actual installation
'' ---------------------------
INSTALLER:
Success% = Install
''
'' Create a Program Manager group
'' ------------------------------
IF GetListItem(CHECKSTATES$, APP_CB) = "ON" AND Success% = INSTALLOK THEN
''
'' Create the needed directories
'' -----------------------------
IF DoesDirExist(DstDir$ + TEXT_DIR) = 0 THEN
CreateDir DstDir$ + TEXT_DIR, cmoNone
END IF
IF DoesDirExist(DstDir$ + IMAGE_DIR) = 0 THEN
CreateDir DstDir$ + IMAGE_DIR, cmoNone
END IF
IF DoesDirExist(DstDir$ + PLAY_DIR) = 0 THEN
CreateDir DstDir$ + PLAY_DIR, cmoNone
END IF
CreateProgmanGroup STR_GROUP, "", cmoNone
CreateProgmanItem STR_GROUP, STR_OIM, DstDir$ + BIN_DIR + "\" + OIM_NAME, ""+DstDir$+BIN_DIR+"\"+OIM_NAME+",0,,,"+DstDir$+BIN_DIR+"\", cmoOverwrite
CreateProgmanItem STR_GROUP, STR_OIR, DstDir$ + BIN_DIR + "\" + OIR_NAME, ""+DstDir$+BIN_DIR+"\"+OIR_NAME+",0,,,"+DstDir$+BIN_DIR+"\", cmoOverwrite
CreateProgmanItem STR_GROUP, STR_README, WinDir$ + "write.exe " + DstDir$ + "\readme.wri", "", cmoOverwrite
CreateProgmanItem "Accessories", STR_MPLAYER, WinDir$ + "mplayer.exe", "", cmoOverwrite
''
'' Create the OIR.INI file
'' -----------------------
GOSUB CREATEINI
i% = DoMsgBox(RESTART_MSG, WINDOW_TITLE, MB_OK + MB_TASKMODAL + MB_ICONINFORMATION)
END IF
''
'' When done, issue dialog
'' -----------------------
QUIT:
EnableCtl3D 1
IF Success% = INSTALLOK THEN
sz$ = UIStartDlg(CUIDLL$, EXITSUCCESS, "FInfo0DlgProc", HELP_DLG, HELP_PROC)
ELSE
sz$ = UIStartDlg(CUIDLL$, EXITFAILURE, "FInfo0DlgProc", HELP_DLG, HELP_PROC)
END IF
UIPop 1
''
'' Clean up all processing
'' -----------------------
CLEANUP:
EnableCtl3D 0
i% = StopCustomSetup (HinstFrame(), HwndFrame ())
END
''
'' ASKQUIT: The user requested quit; does (s)he really want to?
'' ------------------------------------------------------------
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, EXITQUIT, "FInfoDlgProc", HELP_DLG, HELP_PROC)
UIPop 1
IF sz$ = "CONTINUE" THEN
RETURN
END IF
GOTO CLEANUP
''
'' BADPATH: The user entered an invalid destination directory
'' ----------------------------------------------------------
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", HELP_DLG, HELP_PROC)
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
''
'' GETPATH: Get the destination directory for the product
'' ------------------------------------------------------
GETPATH:
EnableCtl3D 1
SetSymbolValue "EditTextIn", DstDir$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DEST_PATH_DLG, "FEditDlgProc", HELP_DLG, HELP_PROC)
IF sz$ = "CONTINUE" THEN
DstDir$ = GetSymbolValue("EditTextOut")
''
'' Truncate display if too long
'' ----------------------------
DestPathLen% = LEN(DstDir$)
IF DestPathLen% > MAX_PATH_STR THEN
i% = DoMsgBox(PATH_MSG, WINDOW_TITLE, MB_OK + MB_TASKMODAL + MB_ICONHAND)
GOTO GETPATHL1
ELSE
IF DestPathLen% > MAX_CHARS THEN
ReplaceListItem DRIVETEXT$, 7, "..." + MID$(DstDir$, DestPathLen% - MAX_CHARS, MAX_CHARS)
ELSE
ReplaceListItem DRIVETEXT$, 7, DstDir$
END IF
END IF
RecalcPath APP_CB
SetDriveStatus
''
''Install only if it will fit
'' --------------------------
IF VAL(GetListItem(DRIVETEXT$, 2)) >= VAL(GetListItem(DRIVETEXT$, 3)) THEN
GOSUB TOOBIG
GOTO GETPATHL1
END IF
UIPop 1
EnableCtl3D 0
GOTO INSTALLER
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKQUIT
GOTO GETPATHL1
ELSE
UIPop 1
GOTO GETPATHL1
END IF
''
'' TOOBIG: The source files won't fit on the requested destination disk
'' --------------------------------------------------------------------
TOOBIG:
sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", HELP_DLG, HELP_PROC)
IF sz$ = "REACTIVATE" THEN
GOTO TOOBIG
END IF
UIPop 1
RETURN
''
'' Create the INI files
'' --------------------
CREATEINI:
IF GetListItem(CHECKSTATES$, APP_CB) = "OFF" THEN
RETURN
END IF
''
'' Create the Open!Info Reader INI file
'' ------------------------------------
IniFile$ = DstDir$ + BIN_DIR + "\" + OIR_INI_NAME
CreateIniKeyValue IniFile$, "Paths", "BinPath", DstDir$ + BIN_DIR, cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "DatabasePath", DstDir$ + MB_DIR, cmoOverwrite
IF (GetListItem(CHECKSTATES$, DEMO_CB) = "ON") THEN
TextDir$ = DstDir$ + TEXT_DIR
ImageDir$ = DstDir$ + IMAGE_DIR
PlayDir$ = DstDir$ + PLAY_DIR
ELSE
TextDir$ = DstDir$ + TEXT_DIR + ";" + SrcDir$ + TEXT_DIR
ImageDir$ = DstDir$ + IMAGE_DIR + ";" + SrcDir$ + IMAGE_DIR
PlayDir$ = DstDir$ + PLAY_DIR + ";" + SrcDir$ + PLAY_DIR
END IF
CreateIniKeyValue IniFile$, "Paths", "TextPath", TextDir$, cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "ImagePath", ImageDir$, cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "AnimationPath", PlayDir$, cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "SoundPath", PlayDir$, cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "VideoPath", PlayDir$, cmoOverwrite
CreateIniKeyValue IniFile$, "Files", "DatabaseName", "mb", cmoOverwrite
CreateIniKeyValue IniFile$, "Files", "ErrorsFile", DstDir$ + "\ERRORS.TXT", cmoOverwrite
''
'' Create the Open!Info Manager INI file
'' -------------------------------------
OimIni$ = DstDir$ + BIN_DIR + "\" + OIM_INI_NAME
CopyFile IniFile$, OimIni$, cmoNone, 0
IniFile$ = OimIni$
CreateIniKeyValue IniFile$, "Paths", "PubDataPath", DstDir$ + MB_DIR + "\INIT", cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "PubSetupPath", DstDir$ + BIN_DIR + "\INIT", cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "PubVfwSetupPath", DstDir$ + BIN_DIR + "\INIT\VFW", cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "PubVfwTmsSetupPath", DstDir$ + BIN_DIR + "\INIT\VFWTMS", cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "PubQtwSetupPath", DstDir$ + BIN_DIR + "\INIT\QTW", cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "PubQtwTmsSetupPath", DstDir$ + BIN_DIR + "\INIT\QTWTMS", cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "BackupPath", DstDir$ + "\BACKUP", cmoOverwrite
CreateIniKeyValue IniFile$, "Paths", "MediaPath", DstDir$ + "\MEDIA", cmoOverwrite
CreateIniKeyValue IniFile$, "Files", "DefaultBackupFile", DstDir$ + "\BACKUP\EXPORTED.OIM", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "SelectionEffect", "Flash", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TypeMoveCtrl", "Goto", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TypePlayerCtrl", "Play", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextAlignment", "Left", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextFontName", "Arial", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextFontSize", "37", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextColor", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextBold", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextItalic", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextUnderline", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextStrikeOut", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextBorder", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "TextShadow", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "LoopDisplay", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "PresentationWidth", "640", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "PresentationHeight", "480", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "PresentationTitle", "0", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "AllowTextSearch", "1", cmoOverwrite
CreateIniKeyValue IniFile$, "Default", "ClearPageBackground", "0", cmoOverwrite
''
'' Clear the local variables
'' -------------------------
IniFile$ = ""
OimIni$ = ""
TextDir$ = ""
ImageDir$ = ""
PlayDir$ = ""
RETURN
''
'' Install: Perform actual installation
'' ------------------------------------
FUNCTION Install STATIC AS INTEGER
SrcDir2$ = SrcDir$ + "\"
EnableCtl3D 1
''
'' Install the program files
'' -------------------------
IF GetListItem(CHECKSTATES$, APP_CB) = "ON" THEN
ClearCopyList
AddSectionFilesToCopyList PROGRAM_SECT, SrcDir2$, DstDir$
AddSectionFilesToCopyList DATABASE_SECT, SrcDir2$, DstDir$
AddSectionFilesToCopyList BACKUP_SECT, SrcDir2$, DstDir$
CopyFilesInCopyList
END IF
''
'' Install Demo Presentation Media Files
'' -------------------------------------
IF GetListItem(CHECKSTATES$, DEMO_CB) = "ON" THEN
ClearCopyList
AddSectionFilesToCopyList DEMO_SECT, SrcDir2$, DstDir$
CopyFilesInCopyList
END IF
''
'' Install Video for Windoes
'' -------------------------
IF GetListItem(CHECKSTATES$, APP_CB) = "ON" THEN
''
'' Detect if the graphics card is DCI enabled
'' ------------------------------------------
DCIProvider$ = ""
i% = DoesIniKeyExist(WinDir$ + "system.ini", "Drivers", "DCI")
IF i% <> 0 THEN
DCIProvider$ = GetIniKeyString(WinDir$ + "system.ini", "Drivers", "DCI")
IF (DCIProvider$ = "DCISVGA") OR (DCIProvider$ = "dcisvga") THEN
DCIProvider$ = ""
END IF
END IF
''
'' Prepare Copy list and check size
'' --------------------------------
ClearCopyList
AddSectionFilesToCopyList MPLAYER_SECT, SrcDir2$ + VFWTMS_DIR, WinDir$
AddSectionFilesToCopyList VFW_SECT, SrcDir2$ + VFWTMS_DIR, WinSysDir$
AddSectionFilesToCopyList WING_SECT, SrcDir2$ + VFWTMS_DIR, WinSysDir$
AddSectionFilesToCopyList TMS_SECT, SrcDir2$ + VFWTMS_DIR, WinSysDir$
SetRestartDir WinDir$
CopyFilesInCopyList
''
'' Updating WIN.INI and SYSTEM.INI
'' -------------------------------
IF VflatdPresent() = 0 THEN
CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
END IF
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
i% = DoesIniKeyExist(WinDir$ + "system.ini", "Drivers", "VIDC.RT21")
IF i% = 0 THEN
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
END IF
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.DUCK", "trueduck.drv", cmoOverwrite
''
'' If a DCI provider card exists then set the ini files
'' ----------------------------------------------------
IF DCIProvider$ <> "" THEN
CreateIniKeyValue WinDir$ + "WIN.INI", "TrueMotion", "VideoHardware", "ON", cmoOverwrite
DCIProvider$ = ""
ELSE
CreateIniKeyValue WinDir$ + "WIN.INI", "TrueMotion", "VideoHardware", "OFF", cmoOverwrite
END IF
Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
i% = DoMsgBox(ANALYZE_MSG, WINDOW_TITLE, MB_OK + MB_TASKMODAL + MB_ICONINFORMATION)
''
'' Profile the display for Video for Windows
'' -----------------------------------------
Run ("profdisp.exe")
''
'' Perform the WinG video profiling exercise
'' -----------------------------------------
Run ("profwing.exe")
''
'' Change the VFW Skip flag to ON
'' ------------------------------
CreateIniKeyValue WinDir$ + "WIN.INI", "MCIAVI", "SkipFrames", "1", cmoOverwrite
END IF
EnableCtl3D 0
SrcDir2$ = ""
Install = INSTALLOK
EXIT FUNCTION
END FUNCTION
''
'' MakePath: Builds path from directory and file
'' ---------------------------------------------
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION
''
'' Adds the specified option files to the copy list
'' ------------------------------------------------
SUB AddOptFilesToCopyList (Option%) STATIC
SrcDir2$ = SrcDir$ + "\"
''
'' Clear the copy list
'' -------------------
ClearCopyList
''
'' Add the requested section to the copy list
'' ------------------------------------------
IF Option% = APP_CB THEN
AddSectionFilesToCopyList PROGRAM_SECT, SrcDir2$, DstDir$
AddSectionFilesToCopyList DATABASE_SECT, SrcDir2$, DstDir$
AddSectionFilesToCopyList BACKUP_SECT, SrcDir2$, DstDir$
AddSectionFilesToCopyList MPLAYER_SECT, SrcDir2$, WinDir$
AddSectionFilesToCopyList VFW_SECT, SrcDir2$, WinSysDir$
AddSectionFilesToCopyList WING_SECT, SrcDir2$, WinSysDir$
AddSectionFilesToCopyList TMS_SECT, SrcDir2$, WinSysDir$
ELSEIF Option% = DEMO_CB THEN
AddSectionFilesToCopyList DEMO_SECT, SrcDir2$, DstDir$
END IF
SrcDir2$ = ""
END SUB
''
'' Enable/Disable Dialog box 3d look and feel
'' ------------------------------------------
SUB EnableCtl3D (Enable%) STATIC
''
'' Only enable 3d if not enabled already, and only disable 3d if
'' not disabled already.
'' -------------------------------------------------------------
IF Enable% <> EnableStatus% THEN
EnableStatus% = Enable%
IF Enable% = 1 THEN
k% = ctl3dRegister (HinstFrame())
k% = ctl3dAutosubclass (HinstFrame())
ELSE
k% = Ctl3dUnregister (HinstFrame())
END IF
END IF
END SUB
''
'' Recalculates disk space for the given option files and sets
'' the status info symbol "StatusItemsText".
'' -----------------------------------------------------------
SUB RecalcPath (Option%) STATIC
CursorSave% = ShowWaitCursor()
AddExtra% = 0
DriveNum% = ASC(ucase$(WinDrive$)) - ASC("A") + 1
''
'' Add the specified section files to the copy list
'' ------------------------------------------------
AddOptFilesToCopyList Option%
''
'' Set the List symbol depending on the section
'' --------------------------------------------
IF Option% = APP_CB THEN
ListSym$ = AppNeeds$
''
'' Add extra cost to Windows drive for ini/progman, etc
'' ----------------------------------------------------
ReplaceListItem ExtraCosts$, DriveNum%, "10240"
AddExtra% = 1
ELSEIF Option% = DEMO_CB THEN
ListSym$ = Opt2Needs$
END IF
''
'' Get required space for the current section
'' ------------------------------------------
StillNeed& = GetCopyListCost(ExtraCosts$, ListSym$, "")
''
'' Set the space required in the dialog text area, after adding
'' any necessary space needed by any drive.
'' ------------------------------------------------------------
SpaceNeeded& = 0
FOR j% = 3 TO 26 STEP 1
SpaceNeeded& = SpaceNeeded& + VAL(GetListItem(ListSym$, j%))
NEXT j%
ReplaceListItem STATUSTEXT$, Option%, STR$(SpaceNeeded& / 1024) + " K"
IF AddExtra% THEN
ReplaceListItem ExtraCosts$, DriveNum%, "0"
END IF
ListSym$ = ""
RestoreCursor CursorSave%
END SUB
''
'' Sets drive status info according to latest disk space calcs
'' -----------------------------------------------------------
SUB SetDriveStatus STATIC
Drive$ = MID$(DstDir$, 1, 1)
SpaceNeeded& = 0
FOR Option% = 1 TO LAST_CB STEP 1
IF GetListItem(CHECKSTATES$, Option%) = "ON" THEN
SpaceNeeded& = SpaceNeeded& + VAL(GetListItem(STATUSTEXT$, Option%))
END IF
NEXT Option%
FreeSpace& = GetFreeSpaceForDrive(Drive$)
''
'' Set the dialog text to show the amount of free space and required
'' space. DO NOT BE ALARMED if the required space changes when you
'' select different destination drives. The GetCopyListCost function
'' takes into account the Hard Disk Drive Cluster Size, and also it
'' adds an extra 16k to each list, for the Windows drive.
'' ------------------------------------------------------------------
ReplaceListItem DRIVETEXT$, 1, Drive$ + ":"
ReplaceListItem DRIVETEXT$, 2, STR$(SpaceNeeded&) + " K"
ReplaceListItem DRIVETEXT$, 3, STR$(FreeSpace& / 1024) + " K"
END SUB